package com.cosina.game.crystallight.engine;

import com.cosina.game.crystallight.MediaPlayerAdapter;


public class Sheild{
	private int quantity = 50;
	
	public boolean isBroken(){
		return this.quantity <= 0;
	}
	
	public String getQuantity(){
		return quantity + "";
	}
	
	public void hit(int attack) {
		this.quantity -= attack;
		if(this.quantity < 0)
			this.quantity = 0;
	}

	public void tryRepair() {
		int current = BattleEngine.manaFlask.getCurrent();
		if(current >= 50){
			BattleEngine.manaFlask.used(50);
			quantity+=5;
			MediaPlayerAdapter.cureHp();
		}else if(current >= 10){
			BattleEngine.manaFlask.used(10);
			quantity+=1;
			MediaPlayerAdapter.cureHp();
		}else{
			MediaPlayerAdapter.cannotCureHp();
		}
	}
}
